package tests

import (
	"gitee.com/captials-team/ubdframe/src/common"
	"gitee.com/captials-team/ubdframe/src/domain/configstc"
	v1log "gitee.com/captials-team/ubdframe/src/pkg/logs"
	"go.uber.org/dig"
	"testing"
)

var TestingDBConfig = configstc.DBConfig{
	DbHost:      "192.168.149.128",
	DbPort:      "3306",
	DbUser:      "root",
	DbPassword:  "root",
	DbName:      "db_ubd_frame",
	TablePrefix: "test_",
}

var TestingApiServer = configstc.ServerConfig{
	Enable:         true,
	ServerBindAddr: "",
	Port:           10000,
}

func NewDi(t *testing.T) *dig.Container {
	di := dig.New()
	common.ErrPanic(di.Provide(func() *dig.Container {
		return di
	}))
	common.ErrPanic(di.Provide(func() v1log.ILog {
		return v1log.NewTestingLog(t, v1log.DebugLog)
	}))
	return di
}
